<?php
/**
 * @link https://ym2.cleverstone.top
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

namespace builder\bundle;

use Yii;

/**
 * ym v2.0
 * @author cleverstone
 * @since ym2.0
 */
class Ym2 extends BaseAsset
{
    public $css = [
        'ym2/ym2.common.css',
    ];

    public $js = [
        'ym2/ym2.js',               // 框架常用封装
        'ym2/ym2.bootstrap.js',     // 框架插件初始化
        'ym2/ym2.context.js',       // 框架数据定义
    ];

    public $depends = [
        CoreAsset::class,
    ];

    /**
     * INIT
     */
    public function init()
    {
        parent::init();

        $viewParams = Yii::$app->view->params;
        $skin = !empty($viewParams['uiTheme']) ? $viewParams['uiTheme'] : '';
        switch ($skin) {
            case 'ym2-theme-white'://白色
                $this->css[] = 'ym2/ym2.theme.white.css';
                break;
            case 'ym2-theme-purple'://紫色
                $this->css[] = 'ym2/ym2.theme.purple.css';
                break;
            case 'ym2-theme-pink'://粉色
                $this->css[] = 'ym2/ym2.theme.pink.css';
                break;
            case 'ym2-theme-cyan'://青色
                $this->css[] = 'ym2/ym2.theme.cyan.css';
                break;
            case 'ym2-theme-green'://绿色
                $this->css[] = 'ym2/ym2.theme.green.css';
                break;
            case 'ym2-theme-red'://红色
                $this->css[] = 'ym2/ym2.theme.red.css';
                break;
            case 'ym2-theme-orange'://橙色
                $this->css[] = 'ym2/ym2.theme.orange.css';
                break;
            case 'ym2-theme-yellow'://黄色
                $this->css[] = 'ym2/ym2.theme.yellow.css';
                break;
            case 'ym2-theme-black'://黑色
            default:
                $this->css[] = 'ym2/ym2.theme.black.css';
        }
    }
}